/**
 * 节流实现
 */
function throttle(fn,wait){
    let prev = null;
    // console.log(prev);
    return function(...args){
        // console.log(this)
        let context = this;
        let now = + new Date();
        if(now - prev >= wait || !prev){
            fn.apply(context,args);
            prev = now;
        }
    }
}

let fn = ()=>{
    console.log('boom')
  }
  
  setInterval(throttle(fn,1000),10)

 
  
